<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="aa" uri="/WEB-INF/tld/ajaxanywhere.tld" %>
<%@ taglib prefix="datapager" uri="/WEB-INF/tld/pageTag.tld" %>
<!doctype html>
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<meta name="viewport"
	content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>jsp</title>
<script src="/webjars/jquery/3.5.1/jquery.js"></script>
<script src="/aa.js"></script>

<link href="/page.css" type="text/css" rel="stylesheet">
<%--<link rel="stylesheet" href="/resources/css/bootstrap.min.css" />
<link rel="stylesheet" href="/resources/css/dashboard.css" />--%>

<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet" >
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js" ></script>


</head>
<body>

	<h1>${msg}</h1>
	<br />
	<%--<button type="button" name="btQuery" id="btQuery">查询列表</button>--%>



	<%--<div class="mb-3 row">
		<label for="staticEmail" class="col-sm-2 col-form-label">ID</label>
		<div class="col-sm-10">
			<input type="text" name="id" readonly class="form-control-plaintext" />
		</div>
	</div>--%>
	<div class="mb-3 row">
		<label for="name" class="col-sm-2 col-form-label">姓名</label>
		<div class="col-sm-10">
			<input type="text" class="form-control" name="name" />
		</div>
	</div>
	<div style="float:right;margin-right: 30px;">
	<button type="button" name="btQuery" class="btn btn-success" id="btQuery" onclick="queryList()" >查询</button>
	</div>
	<%--<form name="searchFrom" id="searchFrom"></form>--%>
	<aa:zone name="zoneJ">
		<ul>
			<c:forEach var="o" items="${page.pageList}" varStatus="s">
				<li>
					<input type="checkbox" class="ck_id" value="${o.id}" data-name="${o.name}" data-createDate="${o.createDate}" />
						${s.count} , id: ${o.id} , name: ${o.name} ,createDate: ${o.createDate}
				</li>
			</c:forEach>
		</ul>
			<datapager:page pageNo="${page.pageNo}" total="${page.total}" totalPage="${page.totalPage}" />
	</aa:zone>
      <div style="float:right;margin-right: 30px;">
		  <button type="button" class="btn btn-primary" id="btSave">保 存</button>
	  </div>
</body>
<script type="text/javascript">

function queryList(){
	let postData={}
	postData.data=JSON.stringify(getQuery())
	postData.url="/j/showDialogIndex"

    ajaxAnywhere.postJsonAjax(postData)
}

ajaxAnywhere.getZonesToReaload=function(){
	return "zoneJ";
}

function getQuery(){
	let json={}
	json.id=$("input[name='id']").val()
	json.name=$("input[name='name']").val()
	json.zone="zoneJ"
	return json
}


$("#btSave").on('click',function(){
	//let arr=[]
	let json={}
	$(".ck_id:checked").each(function(i,v){
		json=v.dataset
		/*arr.push(json.name)*/
	})
	dialogCall(json)
})

</script>
<script src="/page.js"></script>
</html>
